CREATE TABLE [dbo].[Prescription]
(
[PrescriptionID] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[PatientCode] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[PatientName] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[DeliveryDate] [datetime] NOT NULL,
[CreateDate] [datetime] NOT NULL CONSTRAINT [DF_Prescription_CreateDate] DEFAULT (getdate()),
[Address] [nvarchar] (150) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[DateOfBirth] [datetime] NULL,
[PrescribingDoctor] [nvarchar] (100) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[VAT] [decimal] (12, 0) NOT NULL,
[Amount] [decimal] (12, 0) NOT NULL,
[TotalAmount] [decimal] (12, 0) NOT NULL,
[SalesPerson] [nvarchar] (20) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[ExchangeRate] [int] NULL,
[IsVoid] [bit] NOT NULL CONSTRAINT [DF_Prescription_IsVoid] DEFAULT ((0)),
[Remark] [nvarchar] (250) COLLATE SQL_Latin1_General_CP1_CI_AS NULL
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Prescription] ADD CONSTRAINT [PK_Prescription] PRIMARY KEY CLUSTERED  ([PrescriptionID]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[Prescription] ADD CONSTRAINT [FK_Prescription_WebUser] FOREIGN KEY ([SalesPerson]) REFERENCES [dbo].[WebUser] ([UserId])
GO
